package cn.tedu.truetaste.pojo.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Document(indexName = "zpw_index2")
@ApiModel(value="对应搜索的文档entity")
@Data
public class SpuForElastic implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 记录id
     */
    @Id
    @ApiModelProperty(value="spu id")
    private Long id;

    /**
     * SPU名称
     */
    @Field(name = "name",type = FieldType.Text,
            analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value="SPU名称")
    private String name;

    /**
     * 调味
     */
    @Field(name = "sauce")
    @ApiModelProperty(value = "调味")
    private String sauce;

    /**
     * 价格
     */
    @Field(name = "price")
    @ApiModelProperty(value = "价格")
    private Double price;

    /**
     * 当前库存
     */
    @Field(name = "stock")
    @ApiModelProperty(value = "当前库存")
    private Integer stock;

    /**
     * 库存预警阈值
     */
    @Field(name = "stock_threshold")
    @ApiModelProperty(value = "当前库存")
    private Integer stockThreshold;

    /**
     * 菜品id
     */
    @Field(name = "dishes_id")
    @ApiModelProperty(value = "菜品id")
    private Long dishesId;

    /**
     * 菜品名称
     */
    @Field(name="dishes_name",type = FieldType.Text,
            analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value="菜品名称")
    private String dishesName;

    /**
     * 类别id
     *
     */
    @Field(name = "category_id")
    @ApiModelProperty(value = "类别id")
    private Long categoryId;

    /**
     * 类别名称
     */
    @Field(name="category_name",type = FieldType.Text,
            analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    @ApiModelProperty(value="类别名称")
    private String categoryName;

    /**
     * 组图URLs
     */
    @Field(name = "pictures")
    @ApiModelProperty(value = "组图URLs")
    private String pictures;

    /**
     * 关键词列表
     */
    @Field(name = "keywords")
    @ApiModelProperty(value = "关键词列表")
    private String keywords;

    /**
     * 销量
     */
    @Field(name = "sales")
    @ApiModelProperty(value = "销量")
    private Integer sales;

    /**
     * 买家评论数量总和
     */
    @Field(name = "comment_count")
    @ApiModelProperty(value = "买家评论数量总和")
    private Integer commentCount;

    /**
     * 买家好评数量总和
     */
    @Field(name = "positive_comment_count")
    @ApiModelProperty(value = "买家好评数量总和")
    private Integer positiveCommentCount;

    /**
     * 排序序号
     */
    @Field(name = "sort")
    @ApiModelProperty(value = "排序序号")
    private Integer sort;

    /**
     * 是否标记为删除，1=已删除，0=未删除
     */
    @Field(name = "is_deleted")
    @ApiModelProperty(value = "是否标记为删除，1=已删除，0=未删除")
    private Integer isDeleted;

    /**
     * 是否上架（发布），1=已上架，0=未上架 （下架）
     */
    @Field(name = "is_published")
    @ApiModelProperty(value = "是否上架（发布），1=已上架，0=未上架 （下架）")
    private Integer isPublished;

    /**
     * 是否新品，1=新品，0=非新品
     */
    @Field(name = "is_new_arrival")
    @ApiModelProperty(value = "是否新品，1=新品，0=非新品")
    private Integer isNewArrival;

    /**
     * 是否推荐，1=推荐，0=不推荐
     */
    @Field(name = "is_recommend")
    @ApiModelProperty(value = "是否推荐，1=推荐，0=不推荐")
    private Integer isRecommend;

    /**
     * 是否已审核，1=已审核，0=未审核
     */
    @Field(name = "is_checked")
    @ApiModelProperty(value = "是否已审核，1=已审核，0=未审核")
    private Integer isChecked;

    /**
     * 审核
     */
    @Field(name = "check_user")
    @ApiModelProperty(value = "审核")
    private String checkUser;
}
